package com.reger.l2cache.pipeline.pipe;

import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.SerializationException;

import com.reger.l2cache.pipeline.core.PipelineCore;

public class BytesRedisPipeline extends RedisPipeline<byte[], byte[], byte[]> {

	private final RedisSerializer<byte[]> byteRedisSerializer = new RedisSerializer<byte[]>() {

		@Override
		public byte[] serialize(byte[] t) throws SerializationException {
			return t;
		}

		@Override
		public byte[] deserialize(byte[] bytes) throws SerializationException {
			return bytes;
		}
	};

	public BytesRedisPipeline(PipelineCore pipelineCore) {
		super(pipelineCore);
		this.setKeySerializer(byteRedisSerializer);
		this.setHashKeySerializer(byteRedisSerializer);
		this.setValueSerializer(byteRedisSerializer);
	}

}
